package de.bml.versandanzeige;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;

public class StandortErstellenActivity extends Activity {

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		setContentView(R.layout.standort_erstellen);
	}

	public void ok(View view) {
		String label = ((EditText) findViewById(R.id.editText_standort_label))
				.getText().toString();
		Standort.create(label,
				((EditText) findViewById(R.id.editText_standort_details)).getText()
						.toString());
		Toast toast = Toast
				.makeText(getApplicationContext(),
						"Neuer Standort '" + label + "' wurde angelegt.",
						Toast.LENGTH_LONG);
		toast.show();
		finish();
	}

	public void abbrechen(View view) {
		finish();
	}

}
